﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.IRepository;
using Simple.IService;
using Simple.Tools;
using Simple.Tools.SnowFlake;
using SqlSugar;
using System.Diagnostics;

namespace Simple.Web.Core.Controllers
{
	/// <summary>
	/// 
	/// </summary>
	[Route("api/test-tra")]
	[ApiController]
	[AllowAnonymous]
	public class TestTraController : ControllerBase
	{
		/// <summary>
		/// 
		/// </summary>
		[Autowired]
		public ILogger<TestTraController> logger { get; set; }
		/// <summary>
		/// 
		/// </summary>
		[Autowired]
		public IMenuService menuService { get; set; }
		/// <summary>
		/// 
		/// </summary>
		[Autowired]
		public IMenuRepository menuRepository { get; set; }
		/// <summary>
		/// 
		/// </summary>
		[Autowired]
		public ConnectionConfig connectionConfig { get; set; }
		/// <summary>
		/// 
		/// </summary>
		public TestTraController()
		{

		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		[HttpGet("test")]
		public async Task<IActionResult> Test()
		{
			Stopwatch stopwatch = new Stopwatch();

			stopwatch.Start();
			for (int i = 0; i <= 10000; i++)
			{
				// logger.LogInformation(i.ToString());
            }
			stopwatch.Stop();
			logger.LogInformation(stopwatch.ElapsedMilliseconds.ToString());
			//	menuService.TestTra();
			return Ok();
		}

	}
}
